<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>视频</title>
	</head>
	<body>
		<canvas id="c1" width="500" height="400"></canvas>
		<video width="500" height="" controls="controls" src='video/v1.mp4'></video>
		<script>
			var c1 = document.querySelector('#c1');
			var v1 = document.querySelector('video');
			
			var interId;
			var ctx = c1.getContext('2d');
			v1.onplay = function(){
				interId = setInterval(function(){
					// 填充背景
					ctx.clearRect(0,0,500,400);
					ctx.fillRect(0,0,500,400);
					
					ctx.drawImage(v1,0,60,500,280);
					
					ctx.font = '16px 微软雅黑';
					ctx.strokeStyle = 'darkcyan';
					ctx.strokeText('视频名称：Canvas视频绘制',10,35);
				},16)
			}
			v1.onpause = function(){
				clearInterval(interId);
			}
		</script>
	</body>
</html>
